package aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AspectAop {

    @Pointcut(value = "execution(* service.UserService.Insert(..))")
    public void point(){}

    @Before(value = "point()")
    public void before(){
        System.out.println("前置通知");
    }

    @After(value = "point()")
    public void after(){
        System.out.println("后置通知");
    }

    @AfterReturning("point()")
    public void afterR(JoinPoint joinPoint){
        System.out.println("后置返回");
    }
}
